From 833db2d0a60e42c55468254f38dc457fe1b8853c Mon Sep 17 00:00:00 2001 From: "smh22@tempest.cl.cam.ac.uk" Date: Thu, 30 Dec 2004 13:54:43 +0000 Subject: [PATCH] bitkeeper revision 1.1159.1.513 (41d408a3JUgu3aO0DUVuu6Cdvk-wig) update for 2.6 smp changes --- linux-2.4.28-xen-sparse/arch/xen/mm/fault.c | 4 ++-- .../arch/xen/i386/mm/hypervisor.c | 2 ++ .../arch/xen/kernel/evtchn.c | 4 +++- .../include/asm-xen/evtchn.h | 4 ---- .../include/asm-xen/hypervisor.h | 17 +++++++++++++++++ 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/linux-2.4.28-xen-sparse/arch/xen/mm/fault.c b/linux-2.4.28-xen-sparse/arch/xen/mm/fault.c index 76d95ff03a..d19218fe32 100644 --- a/linux-2.4.28-xen-sparse/arch/xen/mm/fault.c +++ b/linux-2.4.28-xen-sparse/arch/xen/mm/fault.c @@ -84,8 +84,8 @@ asmlinkage void do_page_fault(struct pt_regs *regs, error_code &= 3; error_code |= (regs->xcs & 2) << 1; - if ( flush_page_update_queue() != 0 ) - return; + /* ensure all updates have completed */ + flush_page_update_queue(); /* * We fault-in kernel-space virtual memory on-demand. The diff --git a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/hypervisor.c b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/hypervisor.c index c6c7bafef9..9068960f05 100644 --- a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/hypervisor.c +++ b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/hypervisor.c @@ -36,7 +36,9 @@ #include #include #include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) #include +#endif /* * This suffices to protect us if we ever move to SMP domains. diff --git a/linux-2.6.10-xen-sparse/arch/xen/kernel/evtchn.c b/linux-2.6.10-xen-sparse/arch/xen/kernel/evtchn.c index f1a3b17887..9e3b8d06b7 100644 --- a/linux-2.6.10-xen-sparse/arch/xen/kernel/evtchn.c +++ b/linux-2.6.10-xen-sparse/arch/xen/kernel/evtchn.c @@ -42,7 +42,6 @@ #include #include #include -#define XEN_EVTCHN_MASK_OPS #include #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) @@ -64,6 +63,9 @@ static int irq_to_evtchn[NR_IRQS]; DEFINE_PER_CPU(int, virq_to_irq[NR_VIRQS]); /* evtchn <-> IPI mapping. */ +#ifndef NR_IPIS // XXX SMH: temp fix for 2.4 +#define NR_IPIS 1 +#endif DEFINE_PER_CPU(int, ipi_to_evtchn[NR_IPIS]); /* Reference counts for bindings to IRQs. */ diff --git a/linux-2.6.10-xen-sparse/include/asm-xen/evtchn.h b/linux-2.6.10-xen-sparse/include/asm-xen/evtchn.h index a85bf4ba61..59a7ba3991 100644 --- a/linux-2.6.10-xen-sparse/include/asm-xen/evtchn.h +++ b/linux-2.6.10-xen-sparse/include/asm-xen/evtchn.h @@ -48,8 +48,6 @@ asmlinkage void evtchn_do_upcall(struct pt_regs *regs); /* Entry point for notifications into the userland character device. */ void evtchn_device_upcall(int port); -#ifdef XEN_EVTCHN_MASK_OPS - static inline void mask_evtchn(int port) { shared_info_t *s = HYPERVISOR_shared_info; @@ -76,8 +74,6 @@ static inline void unmask_evtchn(int port) } } -#endif /* XEN_EVTCHN_MASK_OPS */ - static inline void clear_evtchn(int port) { shared_info_t *s = HYPERVISOR_shared_info; diff --git a/linux-2.6.10-xen-sparse/include/asm-xen/hypervisor.h b/linux-2.6.10-xen-sparse/include/asm-xen/hypervisor.h index 024452bdbd..e54caa1b99 100644 --- a/linux-2.6.10-xen-sparse/include/asm-xen/hypervisor.h +++ b/linux-2.6.10-xen-sparse/include/asm-xen/hypervisor.h @@ -91,6 +91,23 @@ void xen_set_ldt(unsigned long ptr, unsigned long bytes); void xen_machphys_update(unsigned long mfn, unsigned long pfn); void _flush_page_update_queue(void); + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) +/* +** XXX SMH: 2.4 doesn't have percpu.h (or support SMP guests) so just +** include sufficient #defines to allow the below to build. +*/ +#define DEFINE_PER_CPU(type, name) \ + __typeof__(type) per_cpu__##name + +#define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var)) +#define __get_cpu_var(var) per_cpu__##var +#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name + +#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var) +#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var) +#endif /* linux < 2.6.0 */ + #define flush_page_update_queue() do { \ DECLARE_PER_CPU(unsigned int, mmu_update_queue_idx); \ if (per_cpu(mmu_update_queue_idx, smp_processor_id())) \ -- 2.30.2